﻿using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.SharePoint.Administration;
using Microsoft.SharePoint;

namespace Macaw.Wss3.DependencySpiderSolution
{
    public class DependencyMapStorageCollection : SPPersistedChildCollection<DependencyMapStorage>
    {
        public DependencyMapStorageCollection(SPPersistedObject parent)
            : base(parent)
        {
        }

        public DependencyMapStorage GetDependencyMap(SPSite site)
        {
            DependencyMapStorage dependencymapstorage = this.GetValue<DependencyMapStorage>(site.ID);
            if (dependencymapstorage == null)
            {
                dependencymapstorage = new DependencyMapStorage("DependencyMap", this.Parent, site.ID);
            }
            return dependencymapstorage;
        }

    }
}
